package com.borball.store.dao;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.ibatis.session.SqlSession;

import com.borball.store.domain.ProductAmount;
import com.borball.store.domain.ProductOrder;
import com.borball.store.util.SessionFactory;

public class OrderDAO extends AbstractDAO<ProductOrder> {


	@SuppressWarnings("unchecked")
	public List<ProductAmount> orderByAmount(Map map) {
		if(map == null){
			map = new HashMap();
		}
		SqlSession session = SessionFactory.getInstance().getSqlSessionFactory().openSession();

		try {
			return (List<ProductAmount>) session.selectList(clazz.getName() + ".orderByCustomer", map);
		} finally {
			session.close();
		}
	}
}
